package day03.ext;

import java.util.ArrayList;
import java.util.Collections;

public class EnumSwitchDemo {
    public static void main(String[] args) {
        /*
         * 枚举switch
         */
        ArrayList<Card> cards = new ArrayList<>();
        for (Rank rank: Rank.values()){
            cards.add(new Card(Suit.DIAMOND, rank));
            cards.add(new Card(Suit.CLUB, rank));
            cards.add(new Card(Suit.HEART, rank));
            cards.add(new Card(Suit.SPADE, rank));
        }
        System.out.println(cards);
        Collections.shuffle(cards);
        for(Card card:cards){
            switch (card.getSuit()){
                case CLUB:
                    System.out.println("梅花:"+card);
                    break;
                case SPADE:
                    System.out.println("黑桃:"+card);
            }
        }
    }
}
